-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add error explanation for E0014 #26029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
r? @nrc (rust_highfive has picked a reviewer for you, use r? to override) |
218e94f
to
b14ef25
Compare
Sorry for the slow reply, I've been meaning to comment! Glancing at the short error message (about paths) I thought this might be triggered using a module, type or static in a const, but upon testing it seems these give other errors (due to namespacing). I haven't been able to find an example better than the one you've listed, so with a few tweaks I think this is fine for merging. |
@@ -227,6 +227,23 @@ const Y: i32 = A; | |||
``` | |||
"##, | |||
|
|||
E0014: r##" | |||
Constant variables' value can only be a constant value or a function. Bad |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variables'
thing is a bit awkward, perhaps something like:
Constants can only be initialized by a constant value or, in a future version of Rust, a call to a
const
function. This error indicates the use of a path (likea::b
, orx
) denoting something other than one of these allowed items. Example:
b14ef25
to
ae550bd
Compare
@michaelsproul: No problem. Thanks for your help as always ! |
@GuillaumeGomez: Thanks for your perseverance! I think we can summon @Manishearth 😄 |
@bors: r+ YOU DARE WAKE ME FROM MY SLUMBER??! |
📌 Commit ae550bd has been approved by |
thank you oh great one bows |
Where did I land ? O.o |
And even more : KokaKiwi/rust-sixsixsix#2 |
Part of #24407.